#ifndef _BSP_TM1638_H_
#define _BSP_TM1638_H_

#include "driver/gpio.h"

//TM1638模块相关引脚定义
#define STB_GPIO        GPIO_NUM_10
#define CLK_GPIO        GPIO_NUM_9
#define DIO_GPIO        GPIO_NUM_8
 
//引脚高低电平设置
#define STB_0() gpio_set_level(STB_GPIO,0)
#define STB_1() gpio_set_level(STB_GPIO,1)

#define CLK_0() gpio_set_level(CLK_GPIO,0)
#define CLK_1() gpio_set_level(CLK_GPIO,1)

#define DIO_0() gpio_set_level(DIO_GPIO,0)
#define DIO_1() gpio_set_level(DIO_GPIO,1)

#define DIO_Read() ((uint8_t)gpio_get_level(DIO_GPIO))

#define TM1638_CLK 5

//用户层函数
void TM1638_Init(void); //TM1638初始化函数
// void TM1638_Display_SEG(uint32_t num,uint8_t seg,PointState p); //选择数码管显示0-F
// void TM1638_Display_LED(uint32_t num,LightState light); //指定led亮灭
void TM1638_Up_Num_Show(uint16_t num, uint8_t base, uint8_t dot, uint8_t show);
void TM1638_Down_Num_Show(uint16_t hour, uint16_t minute, uint8_t show);
uint8_t TM1638_ReadKey(void);
void TM1638_Show_Refresh(void);
void TM1638_Clear(void); //TM1638全清
void TM1638_Brightness(uint8_t light);

void LED_AirConditioner(uint8_t en);
void LED_Maternal(uint8_t en);
void LED_Potion_Quantity(uint8_t quantity);
void LED_Run(uint8_t en);
void LED_BLE(uint8_t en);
void LED_WiFi(uint8_t en);
void LED_m(uint8_t en);
void LED_m2(uint8_t en);
void LED_Percentage(uint8_t en);
void LED_Timing(uint8_t en);
void LED_Height(uint8_t en);
void LED_Area(uint8_t en);
void LED_Aroma(uint8_t en);
void LED_Fumigate(uint8_t en);
void LED_Repel(uint8_t en);


#endif

